Sequence grabbers provide a number of functions that allow applications to determine the devices that can be, or the device that is, attached to a given sequence grabber channel. These devices, in turn, allow the channel component to control the digitizing equipment. For example, video channels use video digitizer components, and sound channels use sound input drivers. Applications can use these functions to present a list of available devices to the user, allowing the user to select a specific device for each channel. The sequence grabber passes these functions on to your channel component.
The sequence grabber may use the SGGetChannelDeviceList function to retrieve a list of devices that may be used by your channel.
The sequence grabber can use the SGSetChannelDevice function to assign a device to your channel.
The SGGetChannelDeviceList function uses a device list structure to pass information about one or more channel devices. The SGDeviceListRecord data type defines the format of the device list structure.
typedef struct SGDeviceListRecord {
short count; /* count of devices */
short selectedIndex; /* current device */
long reserved; /* set to 0 */
SGDeviceName entry[1]; /* device names */
} SGDeviceListRecord, *SGDeviceListPtr, **SGDeviceList;
Device list structures contain an array of device name structures. Each device name structure identifies a single device that may be used by the channel. The SGDeviceName data type defines the format of a device name structure.
typedef struct SGDeviceName {
Str63 name; /* device name */
Handle icon; /* device icon */
long flags; /* flags */
long refCon; /* set to 0 */
long reserved; /* set to 0 */
} SGDeviceName;
The SGGetChannelDeviceList function allows the sequence grabber to retrieve a list of the devices that are valid for your channel.
pascal ComponentResult SGGetChannelDeviceList (SGChannel c,
long selectionFlags,
SGDeviceList *list);
This function allows the sequence grabber to retrieve a list of the devices that may be used by your channel. Each entry in this list identifies a valid device by name. Applications may then place these device names into a menu using the sequence grabber's SGAppendDeviceListToMenu function.
Applications may use this function in order to determine the device your channel is currently using. Be sure to set the selectedIndex field properly.
You may use the sequence grabber's SGSortDeviceList function to sort the entries in your device list structure. This function is discussed on SGSortDeviceList .
The SGSetChannelDevice function allows the sequence grabber to assign a device to your channel.
pascal ComponentResult SGSetChannelDevice (SGChannel c,
StringPtr name);
When the sequence grabber calls your SGSetChannelDevice function, your channel should try to use the specified device instead of the device currently in use. The device name must be derived from your channel's device list.